#ifndef DCM_CALL_OUT_H_
#define DCM_CALL_OUT_H_
#include "types.h"
#include "CanTypes.h"
//#include "Dcm_Types.h"
typedef enum{
	DIAG_SLEEP = 0,
	DIAG_WORKING 
}diag_workState;
typedef struct {
	diag_workState   enWorkState;
	uint8_t   u8Timer1msFlag;
	uint8_t   u8Timer10msFlag;
	uint8_t   u8Timer200msFlag;
	uint32_t  u32Time1ms;
	uint32_t  u32Time10ms;
	uint32_t  u32Time200ms;
	uint8_t   resetTime;
	uint8_t   resetFlag;
	uint8_t   programTime;
	uint8_t   programFlag;
	uint8_t   programCondition;	
	uint8_t	  programSessionResponseOverFlag;
}struct_Diag_t;

typedef struct{
	uint8_t	flag;
	uint8_t para;
}EDiagInOutPutCtrl_t;

typedef enum
{
	CTRL_NONE = 0X00,
	CTRL_READ_LICENSE,
	CTRL_WRITE_LICENSE,
	CTRL_READ_SOC_ID,
}ArmOperationt_t;

typedef struct
{
	bool    			ActionFlag;
	bool    			SocAnswerFlag;
	bool    			SocAnswerStatus;
	uint16_t 			SendDataLen;
	ArmOperationt_t 	operation;//1=read,2=write
	uint8_t 			Data[600];
}Uds2Soc_t;

extern Uds2Soc_t Uds2SocCommunication;
extern Uds2Soc_t Uds2SocCommunication;
extern uint8_t EthernetCh[2];
extern uint8_t MACAddress[6];
extern uint8_t PHYIdentifier[3];
extern uint8_t LinkState[5];
extern uint8_t EthernetSignalQuality[1];
extern uint8_t StatisticCounters[40];
extern uint8_t ReadMasterSlave[1];
extern uint8_t RegisterNum[1];
extern uint8_t RegisterValue[72];
extern uint8_t ResetStatisticCounters[4];
extern uint8_t IPAddressList[56];
extern uint8_t EthernetInterfaceList[25];
extern uint8_t ARPTable[10];
extern uint16_t VehicleSpeed;
extern uint8_t NvmSaveFlag;
extern struct_Diag_t g_stAppDiag;

void diag_sysevent_handler(EModule_t module_src, uint8_t *p_event);
void diag_1msTimer(void);
void diag_10msTimer(void);
uint32_t diag_message_handler(EModule_t module_src, EModule_t module_desc, uint8_t *p_message);
void diag_service(void);
uint32_t diag_is_sleep(void);
void Dcm_RxMsgHandler(PduIdType RxPduId, PduInfoType *pStr);
EDiagInOutPutCtrl_t get_inoutput_ctrl_para(void);

#endif


